import io from 'socket.io-client'


const socket = io.connect('ws://localhost:4000')

socket.emit('sendMsg',{name:'abc'})
console.log('客户端向服务器发送的消息',{name:'abc'})


socket.on('receiveMsg',function (data) {
    console.log('客户接收服务器发送的消息',data)
})


